<?php


namespace app\admin\controller;


use app\admin\model\AreaModel;
use app\BaseController;
use think\response\Json;

class Area extends BaseController
{
    /**
     * @return Json
     * @author ran
     * @date 2021-09-23 13:54
     * mailbox 466180170@qq.com
     */
    public function readAdminAreaList():Json
    {
        $request = $this->request->param();
        $type = isset($request['type']) ? (int)$request['type'] : 0;
        $pid = isset($request['pid']) ? (int)$request['pid'] : 0;
        $model = new AreaModel();
        $res          = $model->getShopAdminAreaListResource($pid,$type);
        return $this->success($res,'获取资源成功',$res['dataCount']);
    }

}